import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
import {viteElectronBuild} from "./plugins/vite.electron.build";
import {viteElectronDev} from "./plugins/vite.electron.dev";

// https://vite.dev/config/
export default defineConfig({

  plugins: [
    vue(),
    vueDevTools(),
    viteElectronDev(),
    viteElectronBuild()
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    },
  },
  build: {
    target: 'es2022',
    chunkSizeWarningLimit: 1500,
    terserOptions: {
      compress: {
        keep_infinity: true,
        drop_console: true,
        drop_debugger: true
      }
    },
    reportCompressedSize: false,
    sourcemap: false,
    rollupOptions: {
    }},
  base: './'
})
